import java.io.Console

/**
 * @description: <br/>
 * @date: 2023/12/8 9:50<br/>
 * @author Jy-Jk<br/>
 */
fun main() {
    val person1 = Person("tom", 18)
    val person2 = Person("jerry", 9)
    val person = person1 + person2
    person.printPersonInfo()
    // mock detected commit
    // mock detected second commit
}

fun myPrint(num: Int = 20, message: String = "abc") {
    println("num is $num, message is $message")
}

fun getTextLength(text: String?) = text?.length ?: 0

fun study(student: Student?) {
    student?.let {
        it.study()
        it.sleep()
        // mock second commit
    }
}

fun test(a: Int, b: Int) = a + b

fun test2(a: Int, b: Int) = println("$a====$b")

fun max(a: Int, b: Int) = if (a > b) a else b

fun getScoreIf(name: String) = if (name == "Tom") "不及格"
else if (name == "Jerry") "不及格"
else "及格"

fun getScoreWhen(name: String) = when (name) {
    "Tom" -> "及格"
    "Jerry" -> "及格"
    else -> "不及格"
}

fun paramCheck(num: Number) = when (num) {
    is Int -> println("Integer")
    is Double -> println("Double")
    is Float -> println("Float")
    else -> println("unValid")
}

fun getScoreMulti(name: String) = when {
    name.startsWith("Tom") -> {
        println("Tom, Go Work!")
        "fuck"
    }

    name == "jerry" -> 21
    name == "bark" -> 55.2
    else -> 20
}